/*
 * @Author: lijing
 * @e-mail: 1413979079@qq.com
 * @LastEditors: lijing
 * @Date: 2020-05-11 18:56:48
 * @LastEditTime: 2020-07-04 08:44:31
 * @FilePath: \client\src\model\Utils.ts
 * @Description:tools
 */

class Utils {
  /**
   * 显示遮罩
   */
  static showMask() {
    const maskBg = document.createElement("div");
    maskBg.id = "mask_bg";
    maskBg.style.position = "absolute";
    maskBg.style.top = "0px";
    maskBg.style.left = "0px";
    maskBg.style.width = "100%";
    maskBg.style.height = "100%";
    maskBg.style.backgroundColor = "#777";
    maskBg.style.opacity = "0.6";
    maskBg.style.zIndex = "99";
    document.body.appendChild(maskBg);
  }
  /**
   * 关闭遮罩
   */
  static closeMask() {
    const maskBg = document.getElementById("mask_bg");
    if (maskBg) {
      document.body.removeChild(maskBg);
    }
  }
}
export default Utils;
